Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handle template in BuilderFieldsKeyValue. WF-31 #484

Merged
merged 1 commit into from
Jul 30, 2024

Conversation

madeindjs
Copy link
Collaborator

The issue was BuilderFieldsKeyValue didn't interpret the template syntax and try to JSON.parse it when navigating between "Static List" and "JSON".

I fixed it relying on useEvaluator().getEvaluatedFields which take care of getting the current data and parsing template. It simplify a lot the logic of the component!

It just required that I get and parse instancePath in the parent.

Now everything works as expected, if user modify a template value in "Static list" mode, the template is overwiten by the plain JSON value. We still handle the "undo/redo" as expected.

Screencast.from.2024-07-01.23-45-17.webm

@madeindjs madeindjs marked this pull request as ready for review July 1, 2024 22:05
@ramedina86
Copy link
Collaborator

Beautiful work! Love when things become simpler

@ramedina86 ramedina86 merged commit 37b25b1 into writer:dev Jul 30, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants